package cn.cvs.service.giveapply;

import cn.cvs.dao.giveapply.GiveApplyMapper;
import cn.cvs.pojo.GiveApply;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GiveApplyServiceImpl implements GiveApplyService{

    @Resource
    private GiveApplyMapper giveApplyMapper;

    @Override
    public List<GiveApply> list(Integer state, Integer pageIndex, Integer pageSize) {
        int pageBean = (pageIndex - 1) * pageSize;
        return giveApplyMapper.list(state, pageBean, pageSize);
    }

    @Override
    public int count(Integer state) {
        return giveApplyMapper.count(state);
    }

    @Override
    public int insert(GiveApply giveApply) {
        return giveApplyMapper.insert(giveApply);
    }

    @Override
    public int updateById(GiveApply giveApply) {
        return giveApplyMapper.updateById(giveApply);
    }

    @Override
    public GiveApply selectById(Integer id) {
        return giveApplyMapper.selectById(id);
    }
}
